/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.rainbow.xml;

import java.util.HashMap;
import java.util.Map;
import org.rainbow.annotation.xml.ChildNode;
import org.rainbow.annotation.xml.NodeAttr;
import org.rainbow.annotation.xml.NodeText;
import org.rainbow.annotation.xml.ParentAttr;

/**
 *
 * @author hironaga
 */
class XmlHandleCommand {

    private  XmlHandleCommand() {}

    private static final Map<String, XmlHandleComponent> componetCash;

    static{
        componetCash = new HashMap<String, XmlHandleComponent>();
        componetCash.put(ParentAttr.class.getName(), new ParentAttrHandler());
        componetCash.put(NodeAttr.class.getName(), new NodeAttrHandler());
        componetCash.put(NodeText.class.getName(), new NodeTextHandler());
        componetCash.put(ChildNode.class.getName(), new ChildNodeHandler());
    }

    static XmlHandleComponent getHelperComponent(Class<?> annotCls){

//        if(!componetCash.containsKey(annotCls.getName())){
//            return null;
//        }
        return componetCash.get(annotCls.getName());
    }

}
